from shunt.models import Verse
import datetime

def get_scripture_of_the_day():
# prepare scripture of the day
    total = Verse.objects.all().count()
    now = datetime.datetime.now()
    pseudo_random = round((1.0 / now.day * now.month) * total)
    
    try:
        scripture_of_the_day = Verse.objects.get(pk=int(pseudo_random)) 
    except Verse.DoesNotExist:
        scripture_of_the_day = Verse.objects.all().order_by('?')[:1] [0]
    return scripture_of_the_day
